<template>
  <PageWrapper>
    <template #headerContent> <WorkbenchHeader /> </template>
    <div class="lg:flex">
      <div class="lg:w-7/10 w-full !mr-4 enter-y">
        <ProjectCard :loading="loading" class="enter-y" />
        <DynamicInfo :loading="loading" class="!my-4 enter-y" />
      </div>
      <div class="w-full lg:w-3/10 enter-y">
        <QuickNav :loading="loading" class="enter-y" />

        <Card class="!my-4 enter-y" :loading="loading">
          <img class="mx-auto xl:h-50 h-30" src="../../../assets/svg/illustration.svg" />
        </Card>

        <SaleRadar :loading="loading" class="enter-y" />
        <button @click="clickMe">点我</button>
      </div>
    </div>
  </PageWrapper>
</template>
<script lang="ts" setup>
  import { ref } from 'vue'
  import { Card } from 'ant-design-vue'
  import { PageWrapper } from '/@/components/Page'
  import WorkbenchHeader from './components/WorkbenchHeader.vue'
  import ProjectCard from './components/ProjectCard.vue'
  import QuickNav from './components/QuickNav.vue'
  import DynamicInfo from './components/DynamicInfo.vue'
  import SaleRadar from './components/SaleRadar.vue'

  const loading = ref(true)

  setTimeout(() => {
    loading.value = false
  }, 1500)
function openWindow(url, title, w, h) {
  // Fixes dual-screen position                            Most browsers       Firefox
   
  const width = 600
  const height = 400

  const top  = 30;
  const left = 50;
 
  const newWindow = window.open(url, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=yes, copyhistory=no, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left);

  // Puts focus on the newWindow
  if (window.focus) {
    newWindow.focus();
  }
}
  
  function clickMe(){
    console.log("dianwo")
      const url = 'https://gulp.gcti.edu.cn/oauth2/authorize?app_id=Wlwzt&response_type=code&redirect_uri=https://localhost:3100&scope=base'
  
   openWindow(url, 'ahha',540, 540)
  }
</script>
